﻿using OxyPlot;
using OxyPlot.Axes;
using OxyPlot.Wpf;
using OxyPlotChartingDemo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace OxyPlotChartingDemoCodeVersion
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            //var plotModel1 = new PlotModel();
            //plotModel1.Title = "Two LineSeries";

            var plot = new Plot();
            PlotController controller = new PlotController();
            controller.BindMouseEnter(OxyPlot.PlotCommands.HoverPointsOnlyTrack);

            var linearAxis1 = new OxyPlot.Wpf.LinearAxis();
            linearAxis1.Position = AxisPosition.Bottom;

            plot.Axes.Add(linearAxis1);

            var linearAxis2 = new OxyPlot.Wpf.LinearAxis();

            plot.Axes.Add(linearAxis2);

            var lineSeries1 = new LineSeries();
            lineSeries1.Title = "LineSeries 1";
            lineSeries1.ToolTip = "line series 1";


            MainViewModel viewModel = new MainViewModel();
            lineSeries1.ItemsSource = viewModel.SuccessPoints;

            var lineSeries2 = new LineSeries();
            lineSeries2.Title = "LineSeries 2";
            lineSeries2.ItemsSource = viewModel.FailurePoints;
            lineSeries2.ToolTip = "line series 2";

            plot.Series.Add(lineSeries1);
            plot.Series.Add(lineSeries2);

            grdMain.Children.Add(plot);
        }
    }
}
